package com.sf.fy.uav.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sf.fy.uav.order.entity.FeedbackStatusLog;
import com.sf.fy.uav.order.mapper.FeedbackStatusLogMapper;
import com.sf.fy.uav.order.service.IFeedbackStatusLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 反馈处理状态日志 服务实现类
 * </p>
 *
 * @author LTQ
 * @since 2023-06-09
 */
@Service
public class FeedbackStatusLogServiceImpl extends ServiceImpl<FeedbackStatusLogMapper, FeedbackStatusLog> implements IFeedbackStatusLogService {

    @Autowired
    private FeedbackStatusLogMapper feedbackStatusLogMapper;

    @Override
    public void add(FeedbackStatusLog feedbackStatusLog) {
        feedbackStatusLogMapper.insert(feedbackStatusLog);
    }

    @Override
    public List<FeedbackStatusLog> selectListByFeedbackId(String feedbackId) {
        QueryWrapper<FeedbackStatusLog> feedbackStatusLogQueryWrapper = new QueryWrapper<>();
        feedbackStatusLogQueryWrapper.eq("feedback_id", feedbackId);
        feedbackStatusLogQueryWrapper.orderByAsc("update_time");
        List<FeedbackStatusLog> feedbackStatusLogs = feedbackStatusLogMapper.selectList(feedbackStatusLogQueryWrapper);
        return feedbackStatusLogs;
    }
}
